home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / lib / udev / set_hwclock < prev    next >
Text File  |  2008-09-25  |  620b  |  30 lines

  1. #!/bin/sh
  2. # udev helper for hwclock
  3. #
  4. # This is based on the hwclock.sh init script, but somewhat simplified.
  5.  
  6. [ ! -x /sbin/hwclock ] && exit 0
  7. . /etc/default/rcS
  8.  
  9. [ "$GMT" = "-u" ] && UTC="yes"
  10. case "$UTC" in
  11.     no|"")    GMT="--localtime"
  12.         UTC=""
  13.         ;;
  14.     yes)    GMT="--utc"
  15.         UTC="--utc"
  16.         ;;
  17.     *)        exit 1 ;;
  18. esac
  19.  
  20. case "$BADYEAR" in
  21.     no|"")    BADYEAR="" ;;
  22.     yes)    BADYEAR="--badyear" ;;
  23.     *)        exit 1 ;;
  24. esac
  25.  
  26. # Copies Hardware Clock time to System Clock using the correct
  27. # timezone for hardware clocks in local time, and sets kernel
  28. # timezone. DO NOT REMOVE.
  29. /sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR
  30.